Skip to content

Commit subgraph/abis + subgraph/generated; use rainix-subgraph-test reusable - #2606

Closed
thedavidmeister wants to merge 7 commits into
mainfrom
2026-05-30-subgraph-committed-artifacts
Closed

Commit subgraph/abis + subgraph/generated; use rainix-subgraph-test reusable#2606
thedavidmeister wants to merge 7 commits into
mainfrom
2026-05-30-subgraph-committed-artifacts

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Summary

Resolves #2605. Depends on (merged) rainlanguage/rainix#210.

  • script/build-subgraph.sh — copies the 3 ABIs that subgraph.yaml consumes (RaindexV6, ERC20, DecimalFloat) from out/ to subgraph/abis/, then runs npm ci + graph codegen. Picked up by the new build-subgraph.sh hook in rainix-copy-artifacts.yaml; the existing git diff --exit-code gate catches stale committed copies.
  • Commit subgraph/abis/ (3 raw forge JSONs) and subgraph/generated/ (graph codegen output). Un-gitignored.
  • .prettierignore — skip subgraph/abis/ so the raw forge output matches what the copy-artifacts regen produces, byte-for-byte.
  • subgraph.yaml../out/*.sol/*.json./abis/*.json.
  • test-subgraph.yml — thin wrapper over rainix-subgraph-test (matchstick over committed bindings in the slim #subgraph-shell; no forge build or graph codegen on the test path).
  • Bump rainix to 6ffb49299 (post-List filtering #210).

Test plan

  • copy-artifacts runs the new build-subgraph.sh hook and the diff stays clean.
  • Subgraph unit tests now runs in #subgraph-shell over committed subgraph/abis/ + subgraph/generated/. Matchstick still passes.
  • All other checks remain green.

🤖 Generated with Claude Code

…eusable

Resolves #2605.

- Add script/build-subgraph.sh: copies the 3 ABIs subgraph.yaml needs
  from out/ to subgraph/abis/, runs npm ci + graph codegen. Picked up
  by rainix-copy-artifacts.yaml's build-subgraph.sh hook
  (rainlanguage/rainix#210); the git diff --exit-code gate catches drift.
- Commit subgraph/abis/{Raindex,ERC20,DecimalFloat}.json and
  subgraph/generated/ (un-gitignored).
- .prettierignore: skip subgraph/abis/ so the raw forge JSONs match the
  copy-artifacts regen byte-for-byte.
- subgraph.yaml: ../out/*.sol/*.json -> ./abis/*.json.
- test-subgraph.yml: thin wrapper over rainix-subgraph-test reusable
  (matchstick over committed bindings in the slim subgraph-shell, no
  forge build or graph codegen on the test path).
- Bump rainix to 6ffb49299 (post-#210).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this May 30, 2026
@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@thedavidmeister, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 16 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5dd9e75b-d3cc-43e4-a285-34f622cb7deb

📥 Commits

Reviewing files that changed from the base of the PR and between 4cff9d2 and f3d0165.

⛔ Files ignored due to path filters (5)
  • flake.lock is excluded by !**/*.lock
  • subgraph/generated/Raindex/DecimalFloat.ts is excluded by !**/generated/**
  • subgraph/generated/Raindex/ERC20.ts is excluded by !**/generated/**
  • subgraph/generated/Raindex/Raindex.ts is excluded by !**/generated/**
  • subgraph/generated/schema.ts is excluded by !**/generated/**
📒 Files selected for processing (19)
  • .github/workflows/npm-package-release.yml
  • .github/workflows/test-subgraph.yml
  • .prettierignore
  • REUSE.toml
  • crates/bindings/abis/ERC20.json
  • crates/bindings/abis/IERC20Metadata.json
  • crates/bindings/abis/IInterpreterStoreV3.json
  • crates/bindings/abis/IRaindexV6.json
  • crates/bindings/abis/RaindexV6.json
  • crates/bindings/src/lib.rs
  • prep-all.sh
  • prep-base.sh
  • prep-webapp.sh
  • script/build.sh
  • subgraph/.gitignore
  • subgraph/abis/DecimalFloat.json
  • subgraph/abis/ERC20.json
  • subgraph/abis/Raindex.json
  • subgraph/subgraph.yaml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-05-30-subgraph-committed-artifacts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

thedavidmeister and others added 2 commits May 30, 2026 12:42
prep-base.sh and pointers.sh now do the same thing post artifact-commit
(forge soldeer install + forge build) — meta is committed (build-meta.sh
hook) and the double forge build in prep-base was only there for the
meta-regen cycle. Collapse onto pointers.sh.

Also fix shellcheck SC2068 (quote ${keep[@]} array expansions) and
SC2034 (drop unused GREEN/NC vars) in the surviving prep-*.sh.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- script/build-subgraph.sh: jq '{abi}' instead of cp — forge's full
  artifact JSON (bytecode/metadata/id) embeds build-host paths that
  drift across runners and defeat the rainix-copy-artifacts diff gate.
  Graph CLI + matchstick only read `.abi`, so stripping costs nothing.
- subgraph/abis/*.json: regenerated against the new strip.
- REUSE.toml: add .prettierignore (file added by an earlier commit on
  this branch, missing from the path list, broke rainix-sol / legal).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
thedavidmeister and others added 4 commits May 30, 2026 13:25
rainlanguage/rainix#212 lands two fixes the consumer side needs:
- pkgs.sqlite in rust-build-inputs so rusqlite-using crates compile in
  slim shells (precondition for the future rainix.yaml refactor).
- subgraph-test task does `npm ci` before `docker compose up`, so
  matchstick finds ./node_modules — unblocks this PR's `subgraph-test`
  job which is over committed bindings.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
crates/bindings reads ABIs via `sol!` path args (5 contracts: IRaindexV6,
RaindexV6, ERC20, IERC20Metadata, IInterpreterStoreV3). Without committed
ABIs, any rust crate touching these requires `forge build` first — defeats
the slim-shell story.

Commit the 5 ABIs under crates/bindings/abis/ (jq '{abi}' stripped — forge
JSON bytecode/metadata/id embed build-host paths, non-deterministic across
runners; alloy sol! only reads .abi). Point sol! macros at the new location.

Rename script/build-subgraph.sh -> script/build.sh: one generic
post-CopyArtifacts hook, not "build subgraph" / "build bindings" / etc.
build.sh internally `nix develop -c ...` since the renamed rainix hook
(rainix#213) no longer wraps the call.
@thedavidmeister

Copy link
Copy Markdown
Contributor Author

Folded into #2608 — committed bindings/abis + rainix split ship together.

thedavidmeister added a commit that referenced this pull request May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

subgraph: commit ABIs + generated bindings; matchstick over committed artifacts

1 participant